<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
    <title>Questionnaires List</title>
    <script src="<c:url value="/resources/scripts/jquery-1.7.7.min.js"/>" type="text/javascript"></script>
    <script src="<c:url value="/resources/scripts/script.js"/>" type="text/javascript"></script>
    <script src="<c:url value="/resources/scripts/jquery.tablesorter.min.js"/>" type="text/javascript"></script>
</head>
<body>

<form:form method="POST" id="createQ" commandName="questionnaire">

    <br>
    <table>
        <tr>
            <td>Category:</td>
            <td><form:select path="category.id" class="categories_s">
                <form:option value="0" label="-Select-"/>
                <form:options items="${categoryList}" itemValue="id" itemlabel="name"/>
            </form:select>
                <form:errors path="category"/>
                <form:errors path="category"/></td>

        </tr>
        <tr>
            <td> Title:</td>
            <td><form:label path="title"/>
                <form:input path="title" class="categories_s"/>
                <form:errors path="title"/></td>
        </tr>
        <tr>
            <td colspan="2" id="addQ_button"><input type="button" value="Add questionnaire" class="addQ_button" onclick="addQ()"></td>
        </tr>
    </table>
    <div id="questionsSaved">

    </div>
</form:form>

<form:form>
    <a href="#" class="adddQ" onclick="showNewQuestionForm();">Add question</a>
</form:form>
<div id="newQuestion">

</div>

</body>
</html>


